$(function($) {
	logoWidthAuto();

	var swiper_banner = new Swiper ('#banner_swp', {
    	loop: true,
    	autoplay: 5000,
    
    	pagination: '#banner_swp_pag',
    	paginationClickable :true,
    
    	nextButton: '#banner_swp_bn',
    	prevButton: '#banner_swp_bp',
	}) 

    // if(swiper_banner.slides.length-2 == 1){
    //     swiper_banner.stopAutoplay();
    //     $('#banner_swp_pag').hide();
    // }

	var swiper_year = new Swiper('#event_year_swp', {
        slidesPerView: 7,
        spaceBetween: 10,

        nextButton: '#event_year_swp_bn',
    	prevButton: '#event_year_swp_bp',
    });

    $('#event_year_swp_first').click(function(){
		swiper_year.slideTo(0);
	})

	$('#event_year_swp_last').click(function(){
		swiper_year.slideTo(swiper_year.slides.length);
	})

	var swiper_month = new Swiper('#event_month_swp', {
        slidesPerView: 7,
        spaceBetween: 0,

        nextButton: '#event_month_swp_bn',
    	prevButton: '#event_month_swp_bp',
    });

	$('#event_month_swp_first').click(function(){
		swiper_month.slideTo(0);
	})

	$('#event_month_swp_last').click(function(){
		swiper_month.slideTo(swiper_month.slides.length);
	})

	$('#event_year_swp a').click(function(){
		$('#event_year_swp a').removeClass('onthis');
		$(this).addClass('onthis');
	})

	$('#event_month_swp a').click(function(){
		$('#event_month_swp a').removeClass('onthis');
		$(this).addClass('onthis');
	})

	$('.content_event_list_month_box a').click(function(){
		$('.content_event_list_month_box a').removeClass('onthis');
		$(this).addClass('onthis');
	})

	var swiper_news = new Swiper('#news_index_swp', {
        pagination: '#news_index_swp_pag',
        paginationClickable :true,
        autoplay: 5000,
    });

    var swiper_content = new Swiper('#news_content_swp', {
        pagination: '#news_content_swp_pag',
        paginationClickable :true,
    });

    var swiper_logos = new Swiper('#logos_swp', {
        loop: true,
        autoplay: 5000,

        nextButton: '#logos_swp_bn',
    	prevButton: '#logos_swp_bp',
    });

    var swiper_logos_m = new Swiper('#logos_swp_m', {
        loop: true,
        autoplay: 5000,

        nextButton: '#logos_swp_bn_m',
        prevButton: '#logos_swp_bp_m',
    });

    var swiper_mm = new Swiper ('#mm_swp', {
        loop: true,
        autoplay: 5000,
    
        pagination: '#mm_swp_pag',
        paginationClickable :true,
    }) 

    if(swiper_mm.slides.length-2 == 1){
        swiper_mm.stopAutoplay();
        $('#mm_swp_pag').hide();
    }

    var swiper_er = new Swiper ('#er_swp', {
        loop: true,
        autoplay: 5000,
    
        pagination: '#er_swp_pag',
        paginationClickable :true,
    }) 

    if(swiper_er.slides.length-2 == 1){
        swiper_er.stopAutoplay();
        $('#er_swp_pag').hide();
    }

    console.log($(document).height() - 150);
    if($(document).height() - 150 > $(window).height()){
        $('.bottom_logo').addClass('bottom');
    }else{  
        
    }  
    $(window).scrollTop(0);
});


$(window).resize(function(){
	logoWidthAuto();
});

function logoWidthAuto (){
	var pageWidth = $(window).width();
	var pageHeight = $(window).height();
}